package com.appbee.core.client.modular.impl;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

import com.appbee.core.client.modular.IModul;
import com.appbee.core.client.modular.IModulRegistry;

public class ModulRegistry implements IModulRegistry
{
	private final HashMap<String, IModul> registry = new HashMap<String, IModul>();

	@Override
	public IModul getById(String activityModulId)
	{
		return registry.get(activityModulId);
	}

	@Override
	public void register(String modulId, IModul modul)
	{
		registry.put(modulId, modul);
	}

	@Override
	public List<IModul> getModuls()
	{
		List<IModul> list = new ArrayList<IModul>();
		list.addAll(registry.values());
		return list;
	}

}
